package com.bite.java_chatroom.mapper;

import com.bite.java_chatroom.model.UserInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

@Mapper
public interface UserInfoMapper {
    @Select("select * from user_info where username = #{username}")
    UserInfo selectByUserName(String username);

    @Insert("insert into user_info (username,password) values (#{username},#{password})")
    Integer insertUserInfo(String username, String password);

    @Select("select * from user_info where id = #{id}")
    UserInfo selectById(Integer id);

    @Select("select  id from user_info where username = #{username}")
    Integer selectIdByUserName(String username);
}
